<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<div id="div1">

</div>

<script>
    let div1 = document.getElementById("div1");// 获取节点
    div1.innerText = "hello";// 改变文本内容
    div1.innerHTML = '<a href="https://www.baidu.com">123</a>';// 可以解析HTML
    div1.id = "123";
    div1.className = "hello";
    div1.style.background = "red";// 操作CSS
</script>

</body>
</html>